package teacher.action;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import leader.bean.MidTable;
import leader.service.LeaderService;
import leader.service.MidteaexpService;

import org.apache.struts2.ServletActionContext;

import teacher.bean.Expertclass;
import teacher.bean.Teacher;
import teacher.bean.Midteaexp;
import teacher.service.teacher;

import com.opensymphony.xwork2.ActionSupport;

public class home extends ActionSupport{
	
	private Teacher teacher; 
	List<Expertclass> experter=new ArrayList<Expertclass>();
    List<Integer> teaExp=new ArrayList<Integer>();
	private List<MidTable> midtable;
    String suc;

	public List<MidTable> getMidtable() {
		return midtable;
	}

	public void setMidtable(List<MidTable> midtable) {
		this.midtable = midtable;
	}

	public String getSuc() {
		return suc;
	}

	public void setSuc(String suc) {
		this.suc = suc;
	}

	public List<Expertclass> getExperter() {
		return experter;
	}

	public void setExperter(List<Expertclass> experter) {
		this.experter = experter;
	}

	public Teacher getTeacher() {
		return teacher;
	}

	public void setTeacher(Teacher teacher) {
		this.teacher = teacher;
	}

	public String execute()
	{
		HttpServletRequest request=ServletActionContext.getRequest();		
		Teacher tea1=(Teacher)request.getSession().getAttribute("teacher");
		teacher = new teacher().SelectTeacher(tea1);
		LeaderService LS = new LeaderService();
		experter = LS.selectAllExpertclass();
	    teaExp=new teacher().SelectTeaExp(teacher);
	    MidteaexpService mid = new MidteaexpService();
		if(mid.getAllExpById(tea1).size() > 0) {
			midtable = mid.getAllExpById(tea1);
		}
		return SUCCESS;
	}

}
